import requests

class yyq:
    def __init__(self):
        self.session = requests.Session()
        self.session.get('http://hmshop-test.itheima.net/index.php?m=Home&c=User&a=verify')

    def yyq_1(self):
        url = 'http://hmshop-test.itheima.net/index.php?m=Home&c=User&a=do_login'

        headers = {
            "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
        }
        data = {
            "username": "15879442283",
            "password": "qwer1234"
        }
        res = self.session.post(url=self.url, headers=self.headers, data=data)
        print(res.status_code)

if __name__ == '__main__':
    ca = yyq()
    ca.yyq_1()
